/*
 * TransiCast / Qt
 * (c) 2012 Joachim Pfeiffer
 * Please refer to http://code.google.com/p/transitacst for more information
 */
#include "messagebox.hpp"

MessageBox::MessageBox(QObject *parent) :
    QObject(parent)
{
}

void MessageBox::messageBox(QWidget *parent, QString message, QMessageBox::Icon iconType, QPixmap *iconPixmap)
{
    QMessageBox msgBox(parent);
    msgBox.setText(message);
    if (iconPixmap != NULL)
        msgBox.setIconPixmap(*iconPixmap);
    else
        if (iconType != QMessageBox::NoIcon)
            msgBox.setIcon(iconType);
    msgBox.setAttribute(Qt::WA_TranslucentBackground, false);
    msgBox.addButton(QMessageBox::Ok);
    msgBox.adjustSize();
    msgBox.exec();
    msgBox.deleteLater();
}

